import java.time.LocalDateTime;
class Manager extends User {
    public Manager(String userId, String username, String password,
                   LocalDateTime registerTime, String phoneNumber) {
        super(userId, username, password, registerTime, phoneNumber, "manager");
    }
    @Override
    public boolean changePassword(String oldPassword, String newPassword) {
        if (this.password.equals(oldPassword)) {
            this.password = newPassword;
            return true;
        }
        return false;
    }
    public boolean resetFrontDeskPassword(FrontDesk user) {
        user.setPassword("123456");
        Logger.log("重置前台 " + user.getUsername() + "的密码", this.username);
        return true;
    }
}
class FrontDesk extends User {
    public FrontDesk(String userId, String username, String password,
                     LocalDateTime registerTime, String phoneNumber) {
        super(userId, username, password, registerTime, phoneNumber, "front_desk");
    }
    @Override
    public boolean changePassword(String oldPassword, String newPassword) {
        if (this.password.equals(oldPassword)) {
            this.password = newPassword;
            return true;
        }
        return false;
    }
}

